Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spectrum-web-components/popover

Package Overview
Dependencies
Maintainers
2
Versions
328
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spectrum-web-components/popover

An **sp-popover** is used to display transient content (menus, options, additional actions etc.) and appears when clicking/tapping on a source (tools, buttons, etc.) It stands out via its visual style (stroke and drop shadow) and floats on top of the rest

  • 0.1.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.4K
decreased by-9.03%
Maintainers
2
Weekly downloads
 
Created
Source

Overview

An sp-popover is used to display transient content (menus, options, additional actions etc.) and appears when clicking/tapping on a source (tools, buttons, etc.) It stands out via its visual style (stroke and drop shadow) and floats on top of the rest of the interface. This component does not implement the actual overlay behavior and interactions. This is handled in the Overlay Root and Overlay Trigger

Example

<div
    style="color: var(--spectrum-global-color-gray-800); position: relative; width: 320px; height: 200px"
>
    <sp-popover variant="dialog" open>
        <div style="padding-bottom: 30px; font-size: 18px; font-weight: 700">
            Popover Title
        </div>
        <div style="font-size: 14px">
            Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
            Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake
            sweet roll cake danish candy biscuit halvah
        </div>
    </sp-popover>
</div>

Variants

Default with No Tip

Default popover with no tip and no direction. Popovers will fill up the space of they're containing element by default. The default popover has no padding by default

<div
    style="color: var(--spectrum-global-color-gray-800); width: 320px; height: 200px"
>
    <sp-popover variant="default" open style="max-width: 320px">
        <div style="font-size: 14px; padding: 10px">
            <div
                style="padding-bottom: 30px; font-size: 18px; font-weight: 700"
            >
                Popover Title
            </div>
            <div style="font-size: 14px">
                Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly
                caramels. Icing soufflé chupa chups donut cheesecake. Jelly-o
                chocolate cake sweet roll cake danish candy biscuit halvah
            </div>
        </div>
    </sp-popover>
</div>

Dialog Popovers

Popovers with padding, ideal for dialogs.

<div
    style="color: var(--spectrum-global-color-gray-800); position: relative; width: 320px; height: 200px"
>
    <sp-popover variant="dialog" open>
        <div style="padding-bottom: 30px; font-size: 18px; font-weight: 700">
            Popover Title
        </div>
        <div style="font-size: 14px">
            Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
            Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake
            sweet roll cake danish candy biscuit halvah
        </div>
    </sp-popover>
</div>

Popover with Tip

<div
    style="color: var(--spectrum-global-color-gray-800); position: relative; width: 320px; height: 200px"
>
    <sp-popover variant="dialog" direction="bottom" tip open>
        <div style="padding-bottom: 30px; font-size: 18px; font-weight: 700">
            Popover Title
        </div>
        <div style="font-size: 14px">
            Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
            Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake
            sweet roll cake danish candy biscuit halvah
        </div>
    </sp-popover>
</div>
<div
    style="color: var(--spectrum-global-color-gray-800); position: relative; width: 320px; height: 200px"
>
    <sp-popover variant="dialog" direction="top" tip open>
        <div style="padding-bottom: 30px; font-size: 18px; font-weight: 700">
            Popover Title
        </div>
        <div style="font-size: 14px">
            Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
            Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake
            sweet roll cake danish candy biscuit halvah
        </div>
    </sp-popover>
</div>
<div
    style="color: var(--spectrum-global-color-gray-800); position: relative; width: 320px; height: 200px"
>
    <sp-popover variant="dialog" direction="left" tip open>
        <div style="padding-bottom: 30px; font-size: 18px; font-weight: 700">
            Popover Title
        </div>
        <div style="font-size: 14px">
            Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
            Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake
            sweet roll cake danish candy biscuit halvah
        </div>
    </sp-popover>
</div>
<div
    style="color: var(--spectrum-global-color-gray-800); position: relative; width: 320px; height: 200px"
>
    <sp-popover variant="dialog" direction="right" tip open>
        <div style="padding-bottom: 30px; font-size: 18px; font-weight: 700">
            Popover Title
        </div>
        <div style="font-size: 14px">
            Cupcake ipsum dolor sit amet jelly beans. Chocolate jelly caramels.
            Icing soufflé chupa chups donut cheesecake. Jelly-o chocolate cake
            sweet roll cake danish candy biscuit halvah
        </div>
    </sp-popover>
</div>

Keywords

FAQs

Package last updated on 14 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc